
//
//  LIULeftViewCell.m
//  EasyNotes
//
//  Created by 劉裕 on 1/6/2016.
//  Copyright © 2016年 劉裕. All rights reserved.
//

#import "LIULeftViewCell.h"
#import "LIUTheme.h"

@implementation LIULeftViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView {
    NSString *reuseId = NSStringFromClass([self class]);
    LIULeftViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if (nil == cell) {
        cell = [[LIULeftViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseId];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

- (void)awakeFromNib {
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    self.selectedBackgroundView = [[UIView alloc] initWithFrame:self.bounds];
    self.selectedBackgroundView.backgroundColor = LIUColor(21, 26, 31, 1.0);
    self.accessoryType = selected ? UITableViewCellAccessoryDisclosureIndicator : UITableViewCellAccessoryNone;
    self.textLabel.textColor = selected ? [UIColor whiteColor] : LIUColor(105, 110, 114, 1.0);
}

- (void)setItem:(LIUTheme *)item {
    _item = item;
    self.textLabel.text = NSLocalizedString(item.itemName, nil);
}

@end
